package com.qdlc.p2p.dal.dto;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.qdlc.p2p.common.constant.Global;

/**
 * 投标
 *
 * @author liya
 * @version 1.1.0.0
 */
@Entity
@Table(name = Global.DB_PREFIX + "borrow_tender")
public class BorrowTender implements Serializable {

    private static final long serialVersionUID = 8736268069451811732L;

    /** 主键 */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private long id;

    /** 投资人 */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "user_id")
    private User user;

    /** 借款标 */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "borrow_id")
    private Borrow borrow;

    /** 状态 0投标待处理，1成功，2失败  3已处理 */
    private int status;

    /** 投标金额 */
    private double money;

    /** 有效投标金额 */
    private double account;

    /** 用户真实资金（真正属于用户的金额，体验券不属于用户金额） */
    private double realAmount;

    /** 预还总额(+利息) */
    private double repaymentAccount;

    /** 利息 */
    private double interest;

    /** 已还金额 */
    private double repaymentYesAccount;

    /** 已还利息 */
    private double repaymentYesInterest;

    /** 待还总额 */
    private double waitAccount;

    /** 待还利息 */
    private double waitInterest;

    /** 投标类型 0网站投标;1自动投标;2手机投标 */
    private byte tenderType;

    /** 添加时间 */
    private Date addTime;

    /** ip */
    private String addIp;

    /** 登记债权时候的订单号 */
    private String tenderBilNo;

    /** 登记债权时候的订单日期 */
    private String tenderBilDate;

    /** 投标冻结流水号 */
    private String trxId;

    /** 还款时间-体验 */
    private Date repaymentTime;

    /**
     * 获取主键
     *
     * @return 主键
     */
    public long getId() {
        return id;
    }

    /**
     * 设置主键
     *
     * @param id 要设置的主键
     */
    public void setId(long id) {
        this.id = id;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Borrow getBorrow() {
        return borrow;
    }

    public void setBorrow(Borrow borrow) {
        this.borrow = borrow;
    }

    /**
     * 获取投标状态 0投标待处理，1成功，2失败 3已处理
     *
     * @return 投标状态 0投标待处理，1成功，2失败 3已处理
     */
    public int getStatus() {
        return status;
    }

    /**
     * 设置投标状态 0投标待处理，1成功，2失败  3已处理
     *
     * @param status 0投标待处理，1成功，2失败  3已处理
     */
    public void setStatus(int status) {
        this.status = status;
    }

    /**
     * 获取投标金额
     *
     * @return 投标金额
     */
    public double getMoney() {
        return money;
    }

    /**
     * 设置投标金额
     *
     * @param money 要设置的投标金额
     */
    public void setMoney(double money) {
        this.money = money;
    }

    /**
     * 获取借款总额
     *
     * @return 借款总额
     */
    public double getAccount() {
        return account;
    }

    /**
     * 设置借款总额
     *
     * @param account 要设置的借款总额
     */
    public void setAccount(double account) {
        this.account = account;
    }

    /**
     * 获取用户真实资金
     *
     * @return
     */
    public double getRealAmount() {
        return realAmount;
    }

    /**
     * 设置用户真实资金
     *
     * @param realAmount
     */
    public void setRealAmount(double realAmount) {
        this.realAmount = realAmount;
    }

    /**
     * 获取预还总额(+利息)
     *
     * @return 预还总额(+利息)
     */
    public double getRepaymentAccount() {
        return repaymentAccount;
    }

    /**
     * 设置预还总额(+利息)
     *
     * @param repaymentAccount 要设置的预还总额(+利息)
     */
    public void setRepaymentAccount(double repaymentAccount) {
        this.repaymentAccount = repaymentAccount;
    }

    /**
     * 获取利息
     *
     * @return 利息
     */
    public double getInterest() {
        return interest;
    }

    /**
     * 设置利息
     *
     * @param interest 要设置的利息
     */
    public void setInterest(double interest) {
        this.interest = interest;
    }

    /**
     * 获取已还金额
     *
     * @return 已还金额
     */
    public double getRepaymentYesAccount() {
        return repaymentYesAccount;
    }

    /**
     * 设置已还金额
     *
     * @param repaymentYesAccount 要设置的已还金额
     */
    public void setRepaymentYesAccount(double repaymentYesAccount) {
        this.repaymentYesAccount = repaymentYesAccount;
    }

    /**
     * 获取已还利息
     *
     * @return 已还利息
     */
    public double getRepaymentYesInterest() {
        return repaymentYesInterest;
    }

    /**
     * 设置已还利息
     *
     * @param repaymentYesInterest 要设置的已还利息
     */
    public void setRepaymentYesInterest(double repaymentYesInterest) {
        this.repaymentYesInterest = repaymentYesInterest;
    }

    /**
     * 获取待还总额
     *
     * @return 待还总额
     */
    public double getWaitAccount() {
        return waitAccount;
    }

    /**
     * 设置待还总额
     *
     * @param waitAccount 要设置的待还总额
     */
    public void setWaitAccount(double waitAccount) {
        this.waitAccount = waitAccount;
    }

    /**
     * 获取待还利息
     *
     * @return 待还利息
     */
    public double getWaitInterest() {
        return waitInterest;
    }

    /**
     * 设置待还利息
     *
     * @param waitInterest 要设置的待还利息
     */
    public void setWaitInterest(double waitInterest) {
        this.waitInterest = waitInterest;
    }

    /**
     * 获取投标类型 0网站投标;1自动投标;2手机投标
     *
     * @return 投标类型 0网站投标;1自动投标;2手机投标
     */
    public byte getTenderType() {
        return tenderType;
    }

    /**
     * 设置投标类型 0网站投标;1自动投标;2手机投标
     *
     * @param tenderType 要设置的投标类型 0网站投标;1自动投标;2手机投标
     */
    public void setTenderType(byte tenderType) {
        this.tenderType = tenderType;
    }

    public Date getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    /**
     * 获取ip
     *
     * @return ip
     */
    public String getAddIp() {
        return addIp;
    }

    /**
     * 设置ip
     *
     * @param addIp 要设置的ip
     */
    public void setAddIp(String addIp) {
        this.addIp = addIp;
    }

    public String getTenderBilNo() {
        return tenderBilNo;
    }

    public void setTenderBilNo(String tenderBilNo) {
        this.tenderBilNo = tenderBilNo;
    }

    public String getTenderBilDate() {
        return tenderBilDate;
    }

    public void setTenderBilDate(String tenderBilDate) {
        this.tenderBilDate = tenderBilDate;
    }

    public String getTrxId() {
        return trxId;
    }

    public void setTrxId(String trxId) {
        this.trxId = trxId;
    }

    public Date getRepaymentTime() {
        return repaymentTime;
    }

    public void setRepaymentTime(Date repaymentTime) {
        this.repaymentTime = repaymentTime;
    }

}
